<?php

// use app\models\Articles;

class HomeController extends BaseController
{

    public function home()
    {
        // $article = Articles::first()->toArray();
        // // var_dump($article);die;
        // require dirname(__FILE__).'/../views/articles.html';
        return View::make('articles')
            ->with('article', Articles::find(0))
            ->withTitle('Home')
            ->withShowMsg('hello world');
    }

    public function mail()
    {
        Mail::to(['993512538@qq.com'])
            ->from('zjc348 <zjc348@163.com>')
            ->title('Hello World')
            ->content('<h1>Hello World !</h1>');
        echo '发送邮件成功';
    }

    public function redis()
    {
    	$redis = new Redism();
    	// var_dump($redis);die('1111111');
    	// $redis->auth('JNO3GGPI0eCajaCg');
    	$redis->set('name', 'Evai', 5);

		echo $redis->get('name');
    }

}